package com.xxkj.drugtraceability

import android.app.Application
import android.content.Context
import com.xxkj.drugtraceability.base.Constants
import com.xxkj.drugtraceability.base.appModule
import com.xxkj.drugtraceability.ext.getSpValue
import com.xxkj.drugtraceability.scan.ScanReceiver
import org.koin.android.ext.koin.androidContext
import org.koin.core.context.startKoin
import kotlin.properties.Delegates

/**
 * author: zhoujingjin
 * created on: 2024/9/9 14:30
 * description:
 */
class App:Application(){
    companion object {
        var CONTEXT: Context by Delegates.notNull()
        var token:String=""
    }

    override fun onCreate() {
        super.onCreate()
        CONTEXT = applicationContext
        init()
    }
    private fun init() {
        startKoin {
            androidContext(this@App)
            modules(appModule)
        }
        //注册重构版本的扫码广播
        ScanReceiver().register(this)
    }
}